home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Attribute Paint Tool UI script
- //
- global proc attrPaintValues(string $toolName)
- {
- string $parent = (`toolPropertyWindow -q -location` + "|attrPaint");
- setParent $parent;
-
- string $helpTag = "";
- toolPropertySetCommon $toolName "attrPaint.xpm" $helpTag;
-
- string $currentTab = `tabLayout -query -selectTab attrPaintTabs_L`;
- jasperValues( "attrPaintCtx", $toolName, $currentTab );
-
- toolPropertySelect attrPaint;
- }
-
-
- proc int canFind( string $sArray[], string $ref )
- {
- for( $s in $sArray )
- {
- if( $s == $ref )
- {
- return true;
- }
- }
- return false;
- }
-
- global proc jasperAttrSelectValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- string $name;
- string $DNbuffer[], $SDNbuffer[];
- int $DNsize, $SDNsize;
-
- // =========================================================
- // get the list of paintable depend node name
- // =========================================================
- $cmd = ($jasperCommand + " -q -dns " + $toolName);
- $DNsize = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -dnn " + $toolName);
- $name = `eval $cmd`;
- tokenize( $name, "|", $DNbuffer);
-
- // =========================================================
- // get the list of selected paintable depend node name
- // =========================================================
- $cmd = ($jasperCommand + " -q -sds " + $toolName);
- $SDNsize = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -sdn " + $toolName);
- $name = `eval $cmd`;
- tokenize( $name, "|", $SDNbuffer);
-
-
- textScrollList -e -ra paintableDNList;
- for( $s in $DNbuffer )
- {
- if( !canFind( $SDNbuffer, $s ) )
- {
- textScrollList -e -append $s paintableDNList;
- }
- }
- textScrollList -e -w 165 paintableDNList;
-
-
- textScrollList -e -ra paintSelectedObjList;
- for( $i = 0; $i < $SDNsize; $i++ )
- {
- textScrollList -e -append $SDNbuffer[$i] paintSelectedObjList;
- }
- textScrollList -e -w 165 paintSelectedObjList;
-
- }
-
- global proc jasperAttrValues(
- string $jasperCommand,
- string $toolName,
- string $currentTool,
- int $force
- )
- {
- global string $jasperObjExpanded[];
- global int $jasperObjExpandedSize;
- global int $jasperAttrTabMenuIndex;
-
- string $cmd;
- global int $jasperAttrActive;
-
- if ( !$force && $jasperAttrActive ) {
- return;
- }
- $jasperAttrActive = 1;
-
- // =========================================================
- // get the list of paintable obj name
- // =========================================================
- string $buffer[];
- $cmd = ($jasperCommand + " -q -ots " + $toolName);
- int $size = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -otn " + $toolName);
- string $name = `eval $cmd`;
- tokenize( $name, "|", $buffer);
-
-
- if( $size != $jasperObjExpandedSize )
- {
- jasperObjExpandedReset( $jasperCommand, $toolName, false );
- }
-
- textScrollList -e -w 160 -ra paintableObjTypeList;
- string $objName, $attrName;
- for( $i = 0; $i < $size; $i++ )
- {
- if( $jasperObjExpanded[$i] == true )
- {
- // add object type name
- $objName = ( " - " + $buffer[$i] );
- textScrollList -e -w 160 -append $objName paintableObjTypeList;
-
- // add attr type name
- $cmd = ($jasperCommand + " -e -oth " + $buffer[$i]+" "+$toolName);
- eval $cmd;
- $cmd = ($jasperCommand + " -q -ats " + $toolName);
- int $attrSize = `eval $cmd`;
- $cmd = ($jasperCommand + " -q -atn " + $toolName);
- string $name2 = `eval $cmd`;
-
- string $buffer2[];
- tokenize( $name2, "|", $buffer2);
- for( $j = 0; $j < $attrSize; $j++ )
- {
- // add object type name
- $attrName = ( " " + $buffer2[$j] );
- textScrollList -e -w 160 -append $attrName paintableObjTypeList;
- }
- }
- else
- {
- $objName = ( " + " + $buffer[$i] );
- textScrollList -e -w 160 -append $objName paintableObjTypeList;
- }
- }
- textScrollList -e -w 160 paintableObjTypeList;
-
-
- // =========================================================
- // the rest of the UI for selecting paintable obj type tab
- // =========================================================
- $cmd = ($jasperCommand + " -q -ath " + $toolName);
- textField -e -text `eval $cmd` paintableAttrTypeName;
-
- $cmd = ($jasperCommand + " -q -saveAttrTypeHighlight " + $toolName);
- checkBoxGrp -e -v1 `eval $cmd` saveAttrTypeName;
-
- $cmd = ($jasperCommand + " -q -dti " + $toolName);
- int $typeIndex = `eval $cmd`;
- if( ( $typeIndex > 0 ) && ( $typeIndex < 4 ) )
- {
- radioButtonGrp -e -sl $typeIndex indexRadioButton;
- }
- else
- {
- $cmd = ($jasperCommand + " -e -dti 1 " + $toolName);
- eval $cmd;
- radioButtonGrp -e -sl 1 indexRadioButton;
- }
-
- jasperAttrSelectValues( $jasperCommand, $toolName, $currentTool, $force );
- }
-
-